<template>
  <div class="auto" style="margin-top: 10px;border: 1px solid #F2F6FA;">
    <criteria v-ref:criteria>
      <div novalidate class="form-horizontal" partial>
        <p class="flex-between bg-info" style="padding: 8px;">
          <span>用户查询</span>
          <span class="btn btn-link add-postition" @click="$parent.clear()">清空查询条件</span>
        </p>
        <div class="form-group">
          <label class=" col-sm-3 control-label">楼栋</label>
          <div class="col-sm-9">
            <input  type="text" class="form-control" v-model="model.f_building"
            condition="all_楼栋_14 = '{}'"
            :size="model.f_building ? model.f_building.length : 1">
          </div>
        </div>
        <div class="form-group">
          <label class=" col-sm-3 control-label">单元</label>
          <div class="col-sm-9">
            <input  type="text" class="form-control" v-model="model.f_unit"
            condition="all_单元_13 = '{}'"
            :size="model.f_unit ? model.f_unit.length : 1">
          </div>
        </div>
        <div class="form-group">
          <label class=" col-sm-3 control-label">楼层</label>
          <div class="col-sm-9">
            <input  type="text" class="form-control" v-model="model.f_floor"
            condition="all_楼层_15 = '{}'"
            :size="model.f_floor ? model.f_floor.length : 1">
          </div>
        </div>
        <div class="form-group">
          <label class=" col-sm-3 control-label">门牌号</label>
          <div class="col-sm-9">
            <input  type="text" class="form-control" v-model="model.f_room"
            condition="all_门牌号_16 = '{}'"
            :size="model.f_room ? model.f_room.length : 1">
          </div>
        </div>
      </div>
    </criteria>
  </div>
</template>

<script>
export default {
  title: '用户查询条件',
  methods: {
    getArgs () {
      return this.$refs.criteria.search()
    },
    // 清空所有查询条件
    clear () {
      Object.keys(this.$refs.criteria.model).forEach((key) => {
        this.$refs.criteria.model[key] = ''
      })
    }
  }
}
</script>
